﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
    public class ChiTietDienThoaiBUS
    {
        public static ChiTietDienThoaiDTO LayChiTietDienThoaiTheoID(int id)
        {
            return ChiTietDienThoaiDAO.LayChiTietDienThoaiTheoID(id);
        }

        public static ChiTietDienThoaiDTO LayChiTietDienThoaiTheoMaSanPham(int masanpham)
        {
            return ChiTietDienThoaiDAO.LayChiTietDienThoaiTheoMaSanPham(masanpham);
        }

        public static List<string> LayDanhSachCacLoaiManHinh()
        {
            return ChiTietDienThoaiDAO.LayDanhSachCacLoaiManHinh();
        }

        public static List<string> LayDanhSachCacKieuDang()
        {
            return ChiTietDienThoaiDAO.LayDanhSachCacKieuDang();
        }

        public static List<SanPhamDTO> TimKiemDienThoaiNangCao(string tenhangsanxuat, string kieudang,
            string kichthuocmanhinh, bool bonhotrong, bool bonhongoai, bool _3G, bool wifi)
        {
            List<ChiTietDienThoaiDTO> temp = ChiTietDienThoaiDAO.TimKiemDienThoaiNangCao(tenhangsanxuat, kieudang,
                kichthuocmanhinh, bonhotrong, bonhongoai, _3G, wifi);
            List<SanPhamDTO> result = new List<SanPhamDTO>();
            for (int i = 0; i < temp.Count; i++)
            {
                result.Add(SanPhamBUS.LaySanPhamTheoID(temp[i].MaSanPham));
            }
            return result;
        }
    }
}
